<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>
    <div id="app">
        <div>user:{{user}}</div>
        <div>
            一级分类：<select v-model='user.first_cateid'>

                <option value="" disabled>--请选择--</option>
                <option v-for="item in list1" :key="item.id" :value="item.id">{{item.name}}</option>
            </select>
        </div>
        <div>
            二级分类:
            <select v-model='user.second_cateid'>
                <option value="" disabled>--请选择--</option>
                <option v-for="item in list2" :key="item.id" :value="item.id">{{item.name}}</option>
            </select>
        </div>
        <div>
            商品名称:
            <input type="text" v-model='user.goodsname'>
        </div>
        <div>
            价格:
            <input type="text" v-model='user.price'>
        </div>
        <div>
            市场价格:
            <input type="text" v-model='user.market_price'>
        </div>
        <div>
            商品规格:<select v-model='user.specsid'>
                <option value="" disabled>--请选择--</option>
                <option v-for="item in list3" :key="item.id" :value="item.id">{{item.name}}</option>

            </select>

        </div>
        <div>
            规格属性:<select v-model='user.specsattr'>
                <option value="" disabled>--请选择--</option>
                <option v-for="item in list4" :key="item.id" :value="item.id">{{item.name}}</option>
            </select>

        </div>
        <div>
            是否新品
            <label>
                <input type="radio" v-model="user.isnew" :value="1" name="isnew">是
            </label>
            <label>
                <input type="radio" v-model="user.isnew" :value="2" name="isnew">否
            </label>
        </div>
        <div>
            是否热卖
            <label>
                <input type="radio" v-model="user.ishot" :value="1" name="ishot">是
            </label>
            <label>
                <input type="radio" v-model="user.ishot" :value="2" name="ishot">否
            </label>
            </label>
        </div>
        <div>
            状态 <input type="checkbox" v-model='user.status' @click='add'>
        </div>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                list1: [
                    {
                        id: 0,
                        name: '家用电器'

                    },
                    {
                        id: 1,
                        name: '美妆护肤'

                    },
                    {
                        id: 2,
                        name: '电子产品'

                    },
                ],
                list2: [
                    {
                        id: 1,
                        name: '精华-精华'

                    },
                    {
                        id: 2,
                        name: '爽肤水-爽肤水'

                    },
                    {
                        id: 3,
                        name: '美容仪-美容仪'

                    },

                ],
                list3: [
                    {
                        id: 0,
                        name: '颜色'
                    },
                    {
                        id: 1,
                        name: '大小'
                    },
                    {
                        id: 2,
                        name: '尺寸'
                    }
                ],
                list4: [
                    {
                        id: 1,
                        name: '红色-红色'
                    },
                    {
                        id: 2,
                        name: '黄色-黄色'
                    },
                    {
                        id: 3,
                        name: '绿色-绿色'
                    }
                ],

                user: {
                    first_cateid: [],
                    second_cateid: [],
                    goodsname: '',
                    price: '',
                    market_price: '',
                    specsid: [],
                    specsattr: [],
                    isnew: '',
                    ishot: '',
                    status: true,


                }
            },
            methods: {
                add(){
                    this.checked ===!this.checked
            
                }
            }

        })
    </script>
</body>

</html>